package client

import (
	"context"
	"github.com/golang/protobuf/ptypes/wrappers"
	"github.com/micro/go-micro/v2/client"
	"github.com/micro/go-micro/v2/client/grpc"
	"kop/framework/wrapper"
	"kop/pb/service"
)

var RankingService service.RankingService

func init() {

	var c = grpc.NewClient(client.Wrap(wrapper.ClientLogWrapper))
	_ = c.Init()
	//s.Init(test.Flags()...)

	RankingService = service.NewRankingService("go.micro.srv.ranking", c)
}

func IsWorship(ctx context.Context, Type int32) bool {
	var resp, err = RankingService.IsWorship(ctx, &wrappers.Int32Value{Value: Type})
	if err != nil {
		panic(err)
	}
	return resp.Value
}
